package com.ldzl.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 销售订单表
 * @TableName sc_sales_order
 */
@TableName(value ="sc_sales_order")
@Data
public class ScSalesOrder implements Serializable {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long sales_order_id;

    /**
     * 订单编号
     */
    private String order_code;

    /**
     * 客户ID
     */
    private Long customer_id;

    /**
     * 订单日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date order_date;

    /**
     * 订单状态
     */
    private String status;

    /**
     * 备注
     */
    private String remark;

    /**
     * 逻辑删除标记
     */
    private String is_delete;

    /**
     * 创建人
     */
    private String create_by;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date create_time;

    /**
     * 更新人
     */
    private String update_by;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date update_time;

    /**
     * 交付日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date delivery_date;

    /**
     * 客户编号
     */
    @TableField(exist = false)
    private String customer_code;

    /**
     * 客户名称
     */
    @TableField(exist = false)
    private String customer_name;
    /**
     * 客户联系人
     */
    @TableField(exist = false)
    private String customer_person;

    /**
     * 联系电话
     */
    @TableField(exist = false)
    private String customer_phone;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ScSalesOrder other = (ScSalesOrder) that;
        return (this.getSales_order_id() == null ? other.getSales_order_id() == null : this.getSales_order_id().equals(other.getSales_order_id()))
            && (this.getOrder_code() == null ? other.getOrder_code() == null : this.getOrder_code().equals(other.getOrder_code()))
            && (this.getCustomer_id() == null ? other.getCustomer_id() == null : this.getCustomer_id().equals(other.getCustomer_id()))
            && (this.getOrder_date() == null ? other.getOrder_date() == null : this.getOrder_date().equals(other.getOrder_date()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getIs_delete() == null ? other.getIs_delete() == null : this.getIs_delete().equals(other.getIs_delete()))
            && (this.getCreate_by() == null ? other.getCreate_by() == null : this.getCreate_by().equals(other.getCreate_by()))
            && (this.getCreate_time() == null ? other.getCreate_time() == null : this.getCreate_time().equals(other.getCreate_time()))
            && (this.getUpdate_by() == null ? other.getUpdate_by() == null : this.getUpdate_by().equals(other.getUpdate_by()))
            && (this.getUpdate_time() == null ? other.getUpdate_time() == null : this.getUpdate_time().equals(other.getUpdate_time()))
            && (this.getDelivery_date() == null ? other.getDelivery_date() == null : this.getDelivery_date().equals(other.getDelivery_date()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSales_order_id() == null) ? 0 : getSales_order_id().hashCode());
        result = prime * result + ((getOrder_code() == null) ? 0 : getOrder_code().hashCode());
        result = prime * result + ((getCustomer_id() == null) ? 0 : getCustomer_id().hashCode());
        result = prime * result + ((getOrder_date() == null) ? 0 : getOrder_date().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getIs_delete() == null) ? 0 : getIs_delete().hashCode());
        result = prime * result + ((getCreate_by() == null) ? 0 : getCreate_by().hashCode());
        result = prime * result + ((getCreate_time() == null) ? 0 : getCreate_time().hashCode());
        result = prime * result + ((getUpdate_by() == null) ? 0 : getUpdate_by().hashCode());
        result = prime * result + ((getUpdate_time() == null) ? 0 : getUpdate_time().hashCode());
        result = prime * result + ((getDelivery_date() == null) ? 0 : getDelivery_date().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", sales_order_id=").append(sales_order_id);
        sb.append(", order_code=").append(order_code);
        sb.append(", customer_id=").append(customer_id);
        sb.append(", order_date=").append(order_date);
        sb.append(", status=").append(status);
        sb.append(", remark=").append(remark);
        sb.append(", is_delete=").append(is_delete);
        sb.append(", create_by=").append(create_by);
        sb.append(", create_time=").append(create_time);
        sb.append(", update_by=").append(update_by);
        sb.append(", update_time=").append(update_time);
        sb.append(", delivery_date=").append(delivery_date);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}